-- GENERATED SPELL FOR [Protean Nightmare] --


function spell0_20864(pUnit, Event) --@Gaping Maw,n/a--
pUnit:FullCastSpellOnTarget(36617,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20864', 15600, 1)
end

function spell1_20864(pUnit, Event) --@Gaping Maw,n/a--
pUnit:FullCastSpellOnTarget(38810,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20864', 15600, 1)
end

function spell2_20864(pUnit, Event) --@Infectious Poison,n/a--
pUnit:FullCastSpellOnTarget(36619,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20864', 589, 1)
end

function spell3_20864(pUnit, Event) --@Infectious Poison,n/a--
pUnit:FullCastSpellOnTarget(38811,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20864', 547, 1)
end

function Sorts_20864(pUnit, Event)
local choix_sorts_20864 = math.random(0, 3)
if choix_sorts_20864 == 0 then
pUnit:RegisterEvent('spell0_20864', 1, 1)
end
if choix_sorts_20864 == 1 then
pUnit:RegisterEvent('spell1_20864', 1, 1)
end
if choix_sorts_20864 == 2 then
pUnit:RegisterEvent('spell2_20864', 1, 1)
end
if choix_sorts_20864 == 3 then
pUnit:RegisterEvent('spell3_20864', 1, 1)
end
end

function mob20864_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20864', math.random(1500, 3000), 1)
end

function mob20864_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20864_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20864_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20864, 1, 'mob20864_Action')
RegisterUnitEvent(20864, 2, 'mob20864_Leave')
RegisterUnitEvent(20864, 3, 'mob20864_Kill')
RegisterUnitEvent(20864, 4, 'mob20864_Die')
